﻿/*
-----------------------------------------------
    Rodeo Game Engine
    This file is part of Rodeo Renderer Module
    RendererInterface.h - header file
 
    Copyright(c) Marcin Goryca
-----------------------------------------------
*/
#ifndef RODEO_RENDERER_RENDERERINTERFACE_H_
#define RODEO_RENDERER_RENDERERINTERFACE_H_

//#ifndef RODEO_RENDERER_SHADERSINTERFACE_H_
//#include "renderer\shadersinterface.h"
//#endif

#ifndef RODEO_RENDERER_CGSHADERS_H_
#include "renderer\cgshaders.h"
#endif

#ifndef RODEO_RENDERER_GL_GLSLSHADERS_H_
#include "renderer\gl\glslshaders.h"
#endif

namespace rodeorenderer
{
class RendererInterface
{
public:
    RendererInterface(){}
    virtual ~RendererInterface(){}

    virtual bool run(int w, int h) = 0;
    virtual void render() = 0;
    virtual void update() = 0;

    // Enters the rendering frame
    virtual void enterFrame() = 0;

    // Ends of the rendering frame
    virtual void endFrame() = 0;

    // Event when the window is resized
    virtual void onSize(int w, int h) = 0;
    
    // Orthographic projection
    virtual void enter2d() = 0;

    // Perspective projection
    virtual void enter3d() = 0;
    //virtual bool chooseViewportType(GLViewportType vt) = 0;

    // Enables Lighting on the scene
    virtual bool enableLighting() = 0;
    virtual bool disableLighting() = 0;
    virtual bool enableDepthTest() = 0;
    virtual bool disableDepthTest() = 0;

    // Changes Backgound color of the renderer 
    virtual void backColor(float r, float g, float b, float a) = 0;

    virtual void enableShaders()=0;
    virtual void disableShaders()=0;
    ShadersInterface* getShader()const { return shader_; }

    virtual void setShader(ShadersInterface* si) = 0;

    virtual void enableTexturing() = 0;
    virtual void disableTexturing() = 0;

    virtual void enableBlending() = 0;
    virtual void disableBlending() = 0;

    HWND getHWND() const { return hwnd_; }

    void setHWND(HWND hwnd){ hwnd_ = hwnd; }

    // Checks if GL state is enabled,
    // it can take any GL state as a parameter  
    //virtual bool checkEnabled(GLenum state) = 0;

    //virtual void enableCulling() = 0;
    //virtual void disableCulling() = 0;
    //virtual void cullMode(GLenum mode) = 0;
//==== MEMBERS ====//
protected:
    ShadersInterface* shader_;
    int width_;
    int height_;
    HWND hwnd_;
private:

};
}    //end of rodeorenderer namespace
#endif    //RODEO_RENDERER_RENDERERINTERFACE_H_